package book;

/*
 *Description:
 *User:laoHu
 *Created with Intellij IDEA 2025
 *Data:2025.05.00
 *Time:00:00
 */
public class Book {

    private String bookname;//书名
    private String auther;//作者
    private String type;//类型
    private double price;//价格
    public boolean isBorrowed;//借阅状态

    public Book(String bookname, String auther, String type, double price) {
        this.bookname = bookname;
        this.auther = auther;
        this.type = type;
        this.price = price;
    }

    public void setBookname(String bookname) {this.bookname = bookname;}

    public void setAuther(String auther) {this.auther = auther;}

    public void setType(String type) {this.type = type;}

    public void setPrice(int price) {this.price = price;}

    public String getBookname() {return bookname;}

    public String getAuther() {return auther;}

    public String getType() {return type;}

    public double getPrice() {return price;}

    public boolean isBorrowed() {return isBorrowed;}

    @Override
    public String toString() {
        return "Book{" +
                "bookname='" + bookname + '\'' +
                ", auther='" + auther + '\'' +
                ", type='" + type + '\'' +
                ", price=" + price +
                ", isBorrow='" + ((isBorrowed == true ) ? "已借出" : "未借出") +
                '}';
    }
}
